package com.project.controller;

import com.project.bean.PostBean;
import com.project.service.IPostService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("post")
public class PostController {
    @Autowired
    private IPostService service;
    @RequestMapping("add")
    public String add(int userId, int mainId, String title, String content){
      PostBean post = new PostBean(userId,mainId,title,content);
      service.add(post);
      return "ok";
    }
}
